package vn.axonivy.vision.streams;

import java.util.ArrayList;
import java.util.List;

public class Mapping {
	public static void main(String[] args) {
		/*
		 * The intermediate operation map converts each element into another
		 * object via the given function. The following example converts each
		 * string into an upper-cased string. But you can also use map to
		 * transform each object into another type.
		 */
		List<String> memberNames = new ArrayList<>();
		memberNames.add("Amitabh");
		memberNames.add("Shekhar");
		memberNames.add("Aman");
		memberNames.add("Rahul");
		memberNames.add("Shahrukh");
		memberNames.add("Salman");
		memberNames.add("Yana");
		memberNames.add("Lokesh");

		memberNames.stream().filter((s) -> s.startsWith("A"))
				.map(String::toUpperCase).forEach(System.out::println);
	}
}
